﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Wangzeran.CodeMaker.GUI.Codes
{
    /// <summary>
    /// 数据库管理
    /// </summary>
    public class DBMgt
    {
        /// <summary>
        /// MSSQL测试数据库连接
        /// </summary>
        /// <param name="connString">数据里连接字符串</param>
        /// <returns></returns>
        public static bool MSSQL_TestConnection(string connString)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(connString))
                {
                    conn.Open();
                    conn.Close();
                }
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
